﻿using Naruto.TaskManagement.Entitys.Models;
using Naruto.TaskManagement.Entitys.VM;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Naruto.TaskManagement.IRepository
{
    public interface IUserRepository
    {
        /// <summary>
        /// 根据用户名 获取 用户信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        Task<UserInfoViewModel> GetUserInfoByUserName(string userName);
        /// <summary>
        /// 根据用户id 获取 用户信息
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        Task<GetUserInfoViewModel> GetUserInfoByUserId(string userId);
        /// <summary>
        /// 获取邮箱 通过用户名
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<string> GetEmailByUserName(string userName);

        /// <summary>
        /// 获取用户的邮箱
        /// </summary>
        /// <returns></returns>
        Task<List<string>> GetUserEmail();


        /// <summary>
        /// 根据用户id 获取用户信息
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        Task<GetUserInfoByIdViewModel> GetUserInfoById(string userId);

        /// <summary>
        /// 获取用户的基本信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<GetUserBaseInfoByIdViewModel> GetUserBaseInfoById(string userId);
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="pswd"></param>
        /// <returns></returns>
        Task UpdatePasswordByUserId(string userId, string pswd);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="email"></param>
        /// <param name="pswd"></param>
        /// <returns></returns>
        Task UpdatePasswordByEmail(string email, string pswd);
        /// <summary>
        /// 验证用户名是否存在
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<bool> ExistsUserName(string userName);
        /// <summary>
        /// 验证邮件是否存在
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        Task<bool> ExistsEmail(string email);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        Task Add(User info);

        /// <summary>
        /// 根据组织获取用户信息
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        Task<List<GetUserByOrganizationIdViewModel>> GetUserByOrganizationId(string oid);

        /// <summary>
        /// 根据组织id 获取用户信息
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        Task<List<string>> GetEmailByOrganizationId(string oid);

        /// <summary>
        /// 获取用户的组织id
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<string> GetUserOrganizationId(string userName);

        /// <summary>
        /// 获取用户的名称
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task<string> GetName(string userName);

        /// <summary>
        /// 根据用户名更新组织id
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        Task UpdateOrganizationIdByUserName(string userName, string organizationId);

        /// <summary>
        /// 获取组织下的用户信息
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        Task<List<GetOrganizationIdUserViewModel>> GetOrganizationIdUser(string oid);
        /// <summary>
        /// 获取用户的头像和昵称
        /// </summary>
        /// <param name="userIdList"></param>
        /// <returns></returns>
        Task<List<GetHeardImgUrlNameByUserIdListViewModel>> GetHeardImgUrlNameByUserIdList(List<string> userIdList);
    }
}
